/**
 * author: zhou
 * date: 2017.10.18
 * description: 菜单模型
 * 
 */

const mongoose = require('mongoose');
 
const menuSchema = new mongoose.Schema({
    name: String,                            // 菜单名称
    level: String,                           // 菜单等级
    upLevel: String,                         // 上级菜单
    url: String,                             // 菜单url
    icon: String,                            // 菜单图标
    type: String,                            // 类型 1 学校端菜单 2 家长端菜单
    createDate: {                            // 创建时间
        type: Date,
        default: Date.now
    },
    children: []                             // 子菜单
});

module.exports = mongoose.model('Menu', menuSchema, 'managements.settings.menus');